// map::key_comp
#include <bits/stdc++.h>
using namespace std;
int main ()
{
    map<char,int> mymap;
    map<char,int>::key_compare mycomp = mymap.key_comp();
    mymap['a']=100;
    mymap['b']=200;
    mymap['c']=300;
    cout << "mymap contains:\n";
    char highest = mymap.rbegin()->first;     // key value of last element
    auto it = mymap.begin();
    do {
        cout << it->first << " => " << it->second << '\n';
    } while ( mycomp((*it++).first, highest) );
    cout << '\n';
    return 0;
}